<?php
namespace app\admin\service;

use think\facade\Db;

class BaseService
{
	/**
     * 模型注入
     * @var object
     */
    protected $model;
	
	/**
     * 数据库事务操作
     * @param callable $closure
     * @param bool $isTran
     * @return mixed
     */
    public function transaction(callable $closure, bool $isTran = true)
    {
        return $isTran ? Db::transaction($closure) : $closure();
    }

}
